<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <my-component></my-component>
        <my-component></my-component>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        const myCommon = {

            data() {
                return {
                    num: 10
                }
            },
            methods: {
                click() {
                    this.num++;
                }
            },
            template: '<div>{{num}}</br><button @click="click">按钮</button></div>'
        }

        const vm = new Vue({
            components: {
                MyComponent: myCommon,
            }
        });
        vm.$mount("#app");
    </script>
</body>

</html>